package com.icw.resource.inner.module.mgr;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.icw.configuration.ConstSettings;
import com.icw.decoupling.defi.tool.NotificationManager;
import com.icw.decoupling.impl.module.RestfulMgrImpl;
import com.icw.resource.inner.entity.IcwNotificationRecord;
import com.icw.utility.BeanCtxUtils;

public class IcwNotificationRestfulMgr extends RestfulMgrImpl<IcwNotificationRecord> {

	@Override
	public void post(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response, Map<String, Object> data) throws Exception {
		super.post(params, request, response, data);
		BeanCtxUtils.getBeanByType(NotificationManager.class).push((IcwNotificationRecord) data.get("data"));
	}

	@Override
	public void patch(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response, Map<String, Object> data) throws Exception {
		throw ConstSettings.NOT_ALLOW;
	}

	@Override
	public void delete(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response, Map<String, Object> data) throws Exception {
		throw ConstSettings.NOT_ALLOW;
	}
}
